<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		#box{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
		}
	</style>

	<script>
		
		window.onload= function (argument) {
			box = document.getElementById("box");
			
			color = ['red','blue','green','yellow'];

			i = 0;

			function run() {
				i++;

				if(i==color.length){
					i=0;
				}

				box.style.background = color[i]
			}

			time = setInterval(run,100);

			box.onmouseover= function(){
				clearInterval(time);
			}	

			box.onmouseout= function(){
				time = setInterval(run,100);
			}
		}

	</script>
</head>
<body>
	<div id="box"></div>
</body>
</html>